%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% refformat for prettyref
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \newrefformat{eq}{Eq.~(\textup{\ref{#1}})}
% %%\newrefformat{fig}{Figure \ref{#1} on page \pageref{#1}}
% \newrefformat{fig}{Fig.~\ref{#1}}
% \newrefformat{chap}{Chapter~\ref{#1}}
% \newrefformat{sec}{\S\ref{#1}}
% %%\newrefformat{sec}{Sec.~\ref{#1}}
% %%\newrefformat{sub}{Subsection \ref{#1}}
% \newrefformat{sub}{\S\ref{#1}}
% \newrefformat{tab}{Tab.~\ref{#1}}
% %%\newrefformat{sub}{Sec.~\ref{#1}}
% \newrefformat{qty}{Equality (\ref{#1})}
% \newrefformat{iqty}{Inequality (\ref{#1})}
% \newrefformat{def}{Definition (\ref{#1})}




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% refformat for refstyle this is a replacement for prettyref
%%%% for more details, see http://wiki.lyx.org/LyX/NewInLyX20#refstyle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newref{eq}{refcmd = {Eq.~(\textup{\ref{#1}})}}
\newref{fig}{refcmd = {Fig.~\ref{#1}}}
\newref{chap}{refcmd = {Chapter~\ref{#1}}}
\newref{apdx}{refcmd = {Appendix~\ref{#1}}}
\newref{sec}{refcmd = {\S\ref{#1}}}
\newref{sub}{refcmd = {\S\ref{#1}}}
\newref{tab}{refcmd = {Tab.~\ref{#1}}}
\newref{qty}{refcmd = {Equality (\ref{#1})}}
\newref{iqty}{refcmd = {Inequality (\ref{#1})}}
\newref{def}{refcmd = {Definition (\ref{#1})}}





%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% fancy page header/footer settings
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}






%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Table of content and minitoc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% the pages of the TOC is numbered roman
% and a pdf-bookmark for the TOC is added
% \let\myTOC\tableofcontents
% \renewcommand\tableofcontents{
%    \frontmatter
%    \pdfbookmark[1]{\contentsname}{}
%    \myTOC
%    \mainmatter }

% Mini Table of Contents
% package: minitoc (aka mini-table)
\usepackage{minitoc}
\dominitoc

% title of minitoc
% e.g. for "Overview" use "\mtcsettitle{minitoc}{Overview}"

% for empty title
\mtcsettitle{minitoc}{}

% set indent of minitoc default 24pt
\setlength{\mtcindent}{0pt}

% turn off rules before and after the minitoc's
% \mtcsetrules{minitoc}{off}

% turn off page numbering in minitoc's
\mtcsetpagenumbers{minitoc}{off}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Using biblatex with LyX
%%%% see http://wiki.lyx.org/BibTeX/Biblatex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \usepackage[style=authoryear,natbib=true]{biblatex}
% \bibliography{BibGrphDb}



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% Misc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% that links to image floats jumps to the beginning
% of the float and not to its caption
\usepackage[figure]{hypcap}

% make caption labels bold
\setkomafont{captionlabel}{\bfseries}
\setcapindent{1em}

% enable calculations
\usepackage{calc}

% increase the bottom float placement fraction
\renewcommand{\bottomfraction}{0.5}

% avoid that floats are placed above its sections
\let\mySection\section\renewcommand{\section}{\suppressfloats[t]\mySection}

